#include "Scene15.hpp"

Scene15::Scene15() {
    this->roomDepth = 12.0f;

    b2Vec2 vertices[12];
    vertices[0].Set(-18.0f, -5.0f);
    vertices[1].Set(-14.0f, -5.0f);
    vertices[2].Set(-11.0f, -7.0f);
    vertices[3].Set(14.0f, -7.0f);
    vertices[4].Set(14.0f, -3.0f);
    vertices[5].Set(18.0f, -3.0f);
    vertices[6].Set(18.0f, -1.0f);
    vertices[7].Set(16.0f, -1.0f);
    vertices[8].Set(16.0f, 7.0f);
    vertices[9].Set(-16.0f, 7.0f);
    vertices[10].Set(-16.0f, -3.0f);
    vertices[11].Set(-18.0f, -3.0f);

    this->createRoom(15, vertices, 12);

    b2Vec2 platformVertices[3];
    platformVertices[0].Set(-10.5f, -5.0f);
    platformVertices[1].Set(-2.0f, -5.0f);
    platformVertices[2].Set(-1.0f, -4.5f);

    this->createPlatform(platformVertices, 3);

    b2Vec2 platformVertices2[2];
    platformVertices2[0].Set(-16.0f, 3.0f);
    platformVertices2[1].Set(-14.0f, 3.0f);

    this->createPlatform(platformVertices2, 2);

    b2Vec2 platformVertices3[3];
    platformVertices3[0].Set(-2.0f, 3.0f);
    platformVertices3[1].Set(0.0f, 3.0f);
    platformVertices3[2].Set(0.0f, 7.0f);

    this->createPlatform(platformVertices3, 3);

    this->start = this->createDoor(-16.0f, -4.0f, -1.0f);
    this->exit = this->createDoor(16.0f, -2.0f, 1.0f);
    this->exit->setState(false);
    this->createExit(17.0f, -2.0f);
    this->hero = this->createHero(-18.0f + HeroElement::WIDTH / 2.0f, -5.0f + HeroElement::HEIGHT / 2.0f);

    // First light.
    this->createFlash(-16.0f, -2.15f, -b2_pi / 2.0f, b2Vec2(1000.0f, 1000.0f));
    SpotlightElement* firstLight = this->createSpotlight(-15.0f, 6.0f, -b2_pi / 3.0f, b2_pi / 12.0f, 20.0f, LightElement::attractiveLight);
    this->createSwitch(-1.0f, 3.0f, 0.0f, firstLight);

    // Second light.
    SpotlightElement* secondLight = this->createSpotlight(-5.5f, 6.5f, -b2_pi / 2.0f, b2_pi / 4.0f, 14.0f, LightElement::slipperyLight);
    this->createSwitch(-15.0f, 3.0f, 0.0f, secondLight);
    this->createBox(7.0f, -6.0f);
}
